home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group02b.txt
/
000084_icon-group-sender_Wed Oct 23 08:03:38 2002.msg
< prev
next >
Wrap
Internet Message Format
|
2003-01-02
|
1KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g9NF3IM22344
for icon-group-addresses; Wed, 23 Oct 2002 08:03:19 -0700 (MST)
Message-Id: <200210231503.g9NF3IM22344@baskerville.CS.Arizona.EDU>
From: "Paul W. Abrahams" <abrahams@acm.org>
To: icon-group@cs.arizona.edu
Subject: The "variable" function and records
Date: Tue, 22 Oct 2002 19:46:01 -0400
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
I've been trying to write an Icon version of the COBOL "move corresponding"
facility (also known in PL/I as "by name assignment"). However, I can't
figure out how to use the "variable" function to assign something to a record
component. Here's a test case:
#!/usr/bin/env icon
record r1(a,b,c,d)
procedure main()
local x1
x1:=r1("one","two","three","four")
variable(name(x1.a)):="pete"
write(name(x1.a),":",image(x1.a),":",x1.a)
end
What I get is:
r1.a:"one":one
What I'm striving for is to be able to assign to the "x" field of a record R,
where "x" is a string-valued variable. Is there a way to do that?
Paul